Binary data is data whose unit can take on only two possible states. These are often labelled as 0 and 1 in accordance with the binary numeral system and Boolean algebra.
Binary data occurs in many different technical and scientific fields, where it can be called by different names including bit (binary digit) in computer science, truth value in mathematical logic and related domains and binary variable in statistics.
A collection of bits may have states: see binary number for details. Number of states of a collection of discrete variables depends exponentially on the number of variables, and only as a power law on number of states of each variable. Ten bits have more () states than three (). bits are more than sufficient to represent an information (a number or anything else) that requires decimal digits, so information contained in discrete variables with 3, 4, 5, 6, 7, 8, 9, Neper... states can be ever superseded by allocating two, three, or four times more bits. So, the use of any other small number than 2 does not provide an advantage.
Moreover, Boolean algebra provides a convenient mathematical structure for collection of bits, with a semantic of a collection of propositional variables. Boolean algebra operations are known as "bitwise operations" in computer science. are also well-studied theoretically and easily implementable, either with or by so-named in digital electronics. This contributes to the use of bits to represent different data, even those originally not binary.
Often, binary data is used to represent one of two conceptually opposed values, e.g.:
However, it can also be used for data that is assumed to have only two possible values, even if they are not conceptually opposed or conceptually represent all possible values in the space. For example, binary data is often used to represent the party choices of voters in elections in the United States, i.e. Republican or Democratic. In this case, there is no inherent reason why only two political party should exist, and indeed, other parties do exist in the U.S., but they are so minor that they are generally simply ignored. Modeling continuous data (or categorical data of more than 2 categories) as a binary variable for analysis purposes is called discretization (creating a dichotomy). Like all discretization, it involves discretization error, but the goal is to learn something valuable despite the error: treating it as for the purpose at hand, but remembering that it cannot be assumed to be negligible in general.
Since there are only two possible values, this can be simplified to a single count (a scalar value) by considering one value as "success" and the other as "failure", coding a value of the success as 1 and of the failure as 0 (using only the coordinate for the "success" value, not the coordinate for the "failure" value). For example, if the value A is considered "success" (and thus B is considered "failure"), the data set A, A, B would be represented as 1, 1, 0. When this is grouped, the values are added, while the number of trial is generally tracked implicitly. For example, A, A, B would be grouped as 1 + 1 + 0 = 2 successes (out of trials). Going the other way, count data with is binary data, with the two classes being 0 (failure) or 1 (success).
Counts of i.i.d. binary variables follow a binomial distribution, with the total number of trials (points in the grouped data).
Similarly, counts of i.i.d. categorical variables with more than two categories can be modeled with a multinomial regression. Counts of non-i.i.d. binary data can be modeled by more complicated distributions, such as the beta-binomial distribution (a compound distribution). Alternatively, the relationship can be modeled without needing to explicitly model the distribution of the output variable using techniques from generalized linear models, such as quasi-likelihood and a quasibinomial model; see .
A computer generally accesses memory as a sequence memory locations that consist of a fixed number of bits (often an 8-bit byte) but this varies by memory hardware. Higher-level groupings are often defined as well. For example, word typically refers to a group of bytes and a group of words might be called long word or quadword.
Although binary data can be interpreted as purely numeric, some data is more abstract, representing other concepts based on a mapping scheme. For example, memory can contain computer instructions that can control the computer (i.e. via a computer program).
Memory can also contain data that represents text per a character encoding that encodes human-readable information. Although all computer data is binary data, in practice, binary data generally excludes this text data (plain text). Although technically text data is binary data (as all computer data is binary), a distinction is made between data that encoded as text vs. data that is not. Content that represents text can be binary such as an digital image of text but only data stored as encoded characters is considered text data. All other data is classified as (non-text) binary.
|
|